3.4.22 \(\int \cot ^2(c+d x) \sqrt {a+b \tan (c+d x)} (A+B \tan (c+d x)) \, dx\) [322]

3.4.22.1 Optimal result
3.4.22.2 Mathematica [A] (verified)
3.4.22.3 Rubi [A] (warning: unable to verify)
3.4.22.4 Maple [B] (verified)
3.4.22.5 Fricas [B] (verification not implemented)
3.4.22.6 Sympy [F]
3.4.22.7 Maxima [F]
3.4.22.8 Giac [F(-1)]
3.4.22.9 Mupad [B] (verification not implemented)

3.4.22.1 Optimal result

Integrand size = 33, antiderivative size = 167 \[ \int \cot ^2(c+d x) \sqrt {a+b \tan (c+d x)} (A+B \tan (c+d x)) \, dx=-\frac {(A b+2 a B) \text {arctanh}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a}}\right )}{\sqrt {a} d}+\frac {\sqrt {a-i b} (i A+B) \text {arctanh}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a-i b}}\right )}{d}-\frac {\sqrt {a+i b} (i A-B) \text {arctanh}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a+i b}}\right )}{d}-\frac {A \cot (c+d x) \sqrt {a+b \tan (c+d x)}}{d} \]

output
-(A*b+2*B*a)*arctanh((a+b*tan(d*x+c))^(1/2)/a^(1/2))/d/a^(1/2)+(I*A+B)*arc 
tanh((a+b*tan(d*x+c))^(1/2)/(a-I*b)^(1/2))*(a-I*b)^(1/2)/d-(I*A-B)*arctanh 
((a+b*tan(d*x+c))^(1/2)/(a+I*b)^(1/2))*(a+I*b)^(1/2)/d-A*cot(d*x+c)*(a+b*t 
an(d*x+c))^(1/2)/d
 
3.4.22.2 Mathematica [A] (verified)

Time = 2.65 (sec) , antiderivative size = 235, normalized size of antiderivative = 1.41 \[ \int \cot ^2(c+d x) \sqrt {a+b \tan (c+d x)} (A+B \tan (c+d x)) \, dx=\frac {-\frac {(A b+2 a B) \text {arctanh}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a}}\right )}{\sqrt {a}}+\frac {\frac {\left (A \left (b^2+a \sqrt {-b^2}\right )+b \left (a-\sqrt {-b^2}\right ) B\right ) \text {arctanh}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a-\sqrt {-b^2}}}\right )}{\sqrt {a-\sqrt {-b^2}}}+\frac {\left (A \left (b^2-a \sqrt {-b^2}\right )+b \left (a+\sqrt {-b^2}\right ) B\right ) \text {arctanh}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a+\sqrt {-b^2}}}\right )}{\sqrt {a+\sqrt {-b^2}}}-A b \cot (c+d x) \sqrt {a+b \tan (c+d x)}}{b}}{d} \]

input
Integrate[Cot[c + d*x]^2*Sqrt[a + b*Tan[c + d*x]]*(A + B*Tan[c + d*x]),x]
 
output
(-(((A*b + 2*a*B)*ArcTanh[Sqrt[a + b*Tan[c + d*x]]/Sqrt[a]])/Sqrt[a]) + (( 
(A*(b^2 + a*Sqrt[-b^2]) + b*(a - Sqrt[-b^2])*B)*ArcTanh[Sqrt[a + b*Tan[c + 
 d*x]]/Sqrt[a - Sqrt[-b^2]]])/Sqrt[a - Sqrt[-b^2]] + ((A*(b^2 - a*Sqrt[-b^ 
2]) + b*(a + Sqrt[-b^2])*B)*ArcTanh[Sqrt[a + b*Tan[c + d*x]]/Sqrt[a + Sqrt 
[-b^2]]])/Sqrt[a + Sqrt[-b^2]] - A*b*Cot[c + d*x]*Sqrt[a + b*Tan[c + d*x]] 
)/b)/d
 
3.4.22.3 Rubi [A] (warning: unable to verify)

Time = 1.23 (sec) , antiderivative size = 156, normalized size of antiderivative = 0.93, number of steps used = 17, number of rules used = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.485, Rules used = {3042, 4091, 27, 3042, 4136, 27, 3042, 4022, 3042, 4020, 25, 73, 221, 4117, 73, 221}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \cot ^2(c+d x) \sqrt {a+b \tan (c+d x)} (A+B \tan (c+d x)) \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\sqrt {a+b \tan (c+d x)} (A+B \tan (c+d x))}{\tan (c+d x)^2}dx\)

\(\Big \downarrow \) 4091

\(\displaystyle -\int -\frac {\cot (c+d x) \left (-A b \tan ^2(c+d x)-2 (a A-b B) \tan (c+d x)+A b+2 a B\right )}{2 \sqrt {a+b \tan (c+d x)}}dx-\frac {A \cot (c+d x) \sqrt {a+b \tan (c+d x)}}{d}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {1}{2} \int \frac {\cot (c+d x) \left (-A b \tan ^2(c+d x)-2 (a A-b B) \tan (c+d x)+A b+2 a B\right )}{\sqrt {a+b \tan (c+d x)}}dx-\frac {A \cot (c+d x) \sqrt {a+b \tan (c+d x)}}{d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{2} \int \frac {-A b \tan (c+d x)^2-2 (a A-b B) \tan (c+d x)+A b+2 a B}{\tan (c+d x) \sqrt {a+b \tan (c+d x)}}dx-\frac {A \cot (c+d x) \sqrt {a+b \tan (c+d x)}}{d}\)

\(\Big \downarrow \) 4136

\(\displaystyle \frac {1}{2} \left (\int -\frac {2 (a A-b B+(A b+a B) \tan (c+d x))}{\sqrt {a+b \tan (c+d x)}}dx+(2 a B+A b) \int \frac {\cot (c+d x) \left (\tan ^2(c+d x)+1\right )}{\sqrt {a+b \tan (c+d x)}}dx\right )-\frac {A \cot (c+d x) \sqrt {a+b \tan (c+d x)}}{d}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {1}{2} \left ((2 a B+A b) \int \frac {\cot (c+d x) \left (\tan ^2(c+d x)+1\right )}{\sqrt {a+b \tan (c+d x)}}dx-2 \int \frac {a A-b B+(A b+a B) \tan (c+d x)}{\sqrt {a+b \tan (c+d x)}}dx\right )-\frac {A \cot (c+d x) \sqrt {a+b \tan (c+d x)}}{d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{2} \left ((2 a B+A b) \int \frac {\tan (c+d x)^2+1}{\tan (c+d x) \sqrt {a+b \tan (c+d x)}}dx-2 \int \frac {a A-b B+(A b+a B) \tan (c+d x)}{\sqrt {a+b \tan (c+d x)}}dx\right )-\frac {A \cot (c+d x) \sqrt {a+b \tan (c+d x)}}{d}\)

\(\Big \downarrow \) 4022

\(\displaystyle -\frac {A \cot (c+d x) \sqrt {a+b \tan (c+d x)}}{d}+\frac {1}{2} \left ((2 a B+A b) \int \frac {\tan (c+d x)^2+1}{\tan (c+d x) \sqrt {a+b \tan (c+d x)}}dx-2 \left (\frac {1}{2} (a+i b) (A+i B) \int \frac {1-i \tan (c+d x)}{\sqrt {a+b \tan (c+d x)}}dx+\frac {1}{2} (a-i b) (A-i B) \int \frac {i \tan (c+d x)+1}{\sqrt {a+b \tan (c+d x)}}dx\right )\right )\)

\(\Big \downarrow \) 3042

\(\displaystyle -\frac {A \cot (c+d x) \sqrt {a+b \tan (c+d x)}}{d}+\frac {1}{2} \left ((2 a B+A b) \int \frac {\tan (c+d x)^2+1}{\tan (c+d x) \sqrt {a+b \tan (c+d x)}}dx-2 \left (\frac {1}{2} (a+i b) (A+i B) \int \frac {1-i \tan (c+d x)}{\sqrt {a+b \tan (c+d x)}}dx+\frac {1}{2} (a-i b) (A-i B) \int \frac {i \tan (c+d x)+1}{\sqrt {a+b \tan (c+d x)}}dx\right )\right )\)

\(\Big \downarrow \) 4020

\(\displaystyle -\frac {A \cot (c+d x) \sqrt {a+b \tan (c+d x)}}{d}+\frac {1}{2} \left ((2 a B+A b) \int \frac {\tan (c+d x)^2+1}{\tan (c+d x) \sqrt {a+b \tan (c+d x)}}dx-2 \left (\frac {i (a-i b) (A-i B) \int -\frac {1}{(1-i \tan (c+d x)) \sqrt {a+b \tan (c+d x)}}d(i \tan (c+d x))}{2 d}-\frac {i (a+i b) (A+i B) \int -\frac {1}{(i \tan (c+d x)+1) \sqrt {a+b \tan (c+d x)}}d(-i \tan (c+d x))}{2 d}\right )\right )\)

\(\Big \downarrow \) 25

\(\displaystyle -\frac {A \cot (c+d x) \sqrt {a+b \tan (c+d x)}}{d}+\frac {1}{2} \left ((2 a B+A b) \int \frac {\tan (c+d x)^2+1}{\tan (c+d x) \sqrt {a+b \tan (c+d x)}}dx-2 \left (\frac {i (a+i b) (A+i B) \int \frac {1}{(i \tan (c+d x)+1) \sqrt {a+b \tan (c+d x)}}d(-i \tan (c+d x))}{2 d}-\frac {i (a-i b) (A-i B) \int \frac {1}{(1-i \tan (c+d x)) \sqrt {a+b \tan (c+d x)}}d(i \tan (c+d x))}{2 d}\right )\right )\)

\(\Big \downarrow \) 73

\(\displaystyle -\frac {A \cot (c+d x) \sqrt {a+b \tan (c+d x)}}{d}+\frac {1}{2} \left ((2 a B+A b) \int \frac {\tan (c+d x)^2+1}{\tan (c+d x) \sqrt {a+b \tan (c+d x)}}dx-2 \left (\frac {(a+i b) (A+i B) \int \frac {1}{-\frac {i \tan ^2(c+d x)}{b}-\frac {i a}{b}+1}d\sqrt {a+b \tan (c+d x)}}{b d}+\frac {(a-i b) (A-i B) \int \frac {1}{\frac {i \tan ^2(c+d x)}{b}+\frac {i a}{b}+1}d\sqrt {a+b \tan (c+d x)}}{b d}\right )\right )\)

\(\Big \downarrow \) 221

\(\displaystyle -\frac {A \cot (c+d x) \sqrt {a+b \tan (c+d x)}}{d}+\frac {1}{2} \left ((2 a B+A b) \int \frac {\tan (c+d x)^2+1}{\tan (c+d x) \sqrt {a+b \tan (c+d x)}}dx-2 \left (\frac {\sqrt {a-i b} (A-i B) \arctan \left (\frac {\tan (c+d x)}{\sqrt {a-i b}}\right )}{d}+\frac {\sqrt {a+i b} (A+i B) \arctan \left (\frac {\tan (c+d x)}{\sqrt {a+i b}}\right )}{d}\right )\right )\)

\(\Big \downarrow \) 4117

\(\displaystyle -\frac {A \cot (c+d x) \sqrt {a+b \tan (c+d x)}}{d}+\frac {1}{2} \left (\frac {(2 a B+A b) \int \frac {\cot (c+d x)}{\sqrt {a+b \tan (c+d x)}}d\tan (c+d x)}{d}-2 \left (\frac {\sqrt {a-i b} (A-i B) \arctan \left (\frac {\tan (c+d x)}{\sqrt {a-i b}}\right )}{d}+\frac {\sqrt {a+i b} (A+i B) \arctan \left (\frac {\tan (c+d x)}{\sqrt {a+i b}}\right )}{d}\right )\right )\)

\(\Big \downarrow \) 73

\(\displaystyle -\frac {A \cot (c+d x) \sqrt {a+b \tan (c+d x)}}{d}+\frac {1}{2} \left (\frac {2 (2 a B+A b) \int \frac {1}{\frac {a+b \tan (c+d x)}{b}-\frac {a}{b}}d\sqrt {a+b \tan (c+d x)}}{b d}-2 \left (\frac {\sqrt {a-i b} (A-i B) \arctan \left (\frac {\tan (c+d x)}{\sqrt {a-i b}}\right )}{d}+\frac {\sqrt {a+i b} (A+i B) \arctan \left (\frac {\tan (c+d x)}{\sqrt {a+i b}}\right )}{d}\right )\right )\)

\(\Big \downarrow \) 221

\(\displaystyle -\frac {A \cot (c+d x) \sqrt {a+b \tan (c+d x)}}{d}+\frac {1}{2} \left (-\frac {2 (2 a B+A b) \text {arctanh}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a}}\right )}{\sqrt {a} d}-2 \left (\frac {\sqrt {a-i b} (A-i B) \arctan \left (\frac {\tan (c+d x)}{\sqrt {a-i b}}\right )}{d}+\frac {\sqrt {a+i b} (A+i B) \arctan \left (\frac {\tan (c+d x)}{\sqrt {a+i b}}\right )}{d}\right )\right )\)

input
Int[Cot[c + d*x]^2*Sqrt[a + b*Tan[c + d*x]]*(A + B*Tan[c + d*x]),x]
 
output
(-2*((Sqrt[a - I*b]*(A - I*B)*ArcTan[Tan[c + d*x]/Sqrt[a - I*b]])/d + (Sqr 
t[a + I*b]*(A + I*B)*ArcTan[Tan[c + d*x]/Sqrt[a + I*b]])/d) - (2*(A*b + 2* 
a*B)*ArcTanh[Sqrt[a + b*Tan[c + d*x]]/Sqrt[a]])/(Sqrt[a]*d))/2 - (A*Cot[c 
+ d*x]*Sqrt[a + b*Tan[c + d*x]])/d
 

3.4.22.3.1 Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 73
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[ 
{p = Denominator[m]}, Simp[p/b   Subst[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + 
 d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] && Lt 
Q[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntL 
inearQ[a, b, c, d, m, n, x]
 

rule 221
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x 
/Rt[-a/b, 2]], x] /; FreeQ[{a, b}, x] && NegQ[a/b]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4020
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*tan[(e_.) + 
(f_.)*(x_)]), x_Symbol] :> Simp[c*(d/f)   Subst[Int[(a + (b/d)*x)^m/(d^2 + 
c*x), x], x, d*Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[ 
b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && EqQ[c^2 + d^2, 0]
 

rule 4022
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + 
 (f_.)*(x_)]), x_Symbol] :> Simp[(c + I*d)/2   Int[(a + b*Tan[e + f*x])^m*( 
1 - I*Tan[e + f*x]), x], x] + Simp[(c - I*d)/2   Int[(a + b*Tan[e + f*x])^m 
*(1 + I*Tan[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c 
 - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] &&  !IntegerQ[m]
 

rule 4091
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + 
 (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Si 
mp[(A*b - a*B)*(a + b*Tan[e + f*x])^(m + 1)*((c + d*Tan[e + f*x])^n/(f*(m + 
 1)*(a^2 + b^2))), x] + Simp[1/(b*(m + 1)*(a^2 + b^2))   Int[(a + b*Tan[e + 
 f*x])^(m + 1)*(c + d*Tan[e + f*x])^(n - 1)*Simp[b*B*(b*c*(m + 1) + a*d*n) 
+ A*b*(a*c*(m + 1) - b*d*n) - b*(A*(b*c - a*d) - B*(a*c + b*d))*(m + 1)*Tan 
[e + f*x] - b*d*(A*b - a*B)*(m + n + 1)*Tan[e + f*x]^2, x], x], x] /; FreeQ 
[{a, b, c, d, e, f, A, B}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && 
NeQ[c^2 + d^2, 0] && LtQ[m, -1] && LtQ[0, n, 1] && (IntegerQ[m] || Integers 
Q[2*m, 2*n])
 

rule 4117
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*tan[(e_.) 
+ (f_.)*(x_)])^(n_.)*((A_) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> 
 Simp[A/f   Subst[Int[(a + b*x)^m*(c + d*x)^n, x], x, Tan[e + f*x]], x] /; 
FreeQ[{a, b, c, d, e, f, A, C, m, n}, x] && EqQ[A, C]
 

rule 4136
Int[(((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_)*((A_.) + (B_.)*tan[(e_.) 
+ (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2))/((a_.) + (b_.)*tan[(e_.) 
+ (f_.)*(x_)]), x_Symbol] :> Simp[1/(a^2 + b^2)   Int[(c + d*Tan[e + f*x])^ 
n*Simp[b*B + a*(A - C) + (a*B - b*(A - C))*Tan[e + f*x], x], x], x] + Simp[ 
(A*b^2 - a*b*B + a^2*C)/(a^2 + b^2)   Int[(c + d*Tan[e + f*x])^n*((1 + Tan[ 
e + f*x]^2)/(a + b*Tan[e + f*x])), x], x] /; FreeQ[{a, b, c, d, e, f, A, B, 
 C, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] & 
&  !GtQ[n, 0] &&  !LeQ[n, -1]
 
3.4.22.4 Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(1028\) vs. \(2(141)=282\).

Time = 0.22 (sec) , antiderivative size = 1029, normalized size of antiderivative = 6.16

method result size
derivativedivides \(\text {Expression too large to display}\) \(1029\)
default \(\text {Expression too large to display}\) \(1029\)

input
int(cot(d*x+c)^2*(a+b*tan(d*x+c))^(1/2)*(A+B*tan(d*x+c)),x,method=_RETURNV 
ERBOSE)
 
output
1/4/d/b*ln(b*tan(d*x+c)+a+(a+b*tan(d*x+c))^(1/2)*(2*(a^2+b^2)^(1/2)+2*a)^( 
1/2)+(a^2+b^2)^(1/2))*A*(2*(a^2+b^2)^(1/2)+2*a)^(1/2)*(a^2+b^2)^(1/2)-1/4/ 
d/b*ln(b*tan(d*x+c)+a+(a+b*tan(d*x+c))^(1/2)*(2*(a^2+b^2)^(1/2)+2*a)^(1/2) 
+(a^2+b^2)^(1/2))*A*(2*(a^2+b^2)^(1/2)+2*a)^(1/2)*a+1/4/d*ln(b*tan(d*x+c)+ 
a+(a+b*tan(d*x+c))^(1/2)*(2*(a^2+b^2)^(1/2)+2*a)^(1/2)+(a^2+b^2)^(1/2))*B* 
(2*(a^2+b^2)^(1/2)+2*a)^(1/2)+1/d/(2*(a^2+b^2)^(1/2)-2*a)^(1/2)*arctan((2* 
(a+b*tan(d*x+c))^(1/2)+(2*(a^2+b^2)^(1/2)+2*a)^(1/2))/(2*(a^2+b^2)^(1/2)-2 
*a)^(1/2))*B*(a^2+b^2)^(1/2)-1/d*b/(2*(a^2+b^2)^(1/2)-2*a)^(1/2)*arctan((2 
*(a+b*tan(d*x+c))^(1/2)+(2*(a^2+b^2)^(1/2)+2*a)^(1/2))/(2*(a^2+b^2)^(1/2)- 
2*a)^(1/2))*A-1/d/(2*(a^2+b^2)^(1/2)-2*a)^(1/2)*arctan((2*(a+b*tan(d*x+c)) 
^(1/2)+(2*(a^2+b^2)^(1/2)+2*a)^(1/2))/(2*(a^2+b^2)^(1/2)-2*a)^(1/2))*B*a-1 
/4/d/b*ln((a+b*tan(d*x+c))^(1/2)*(2*(a^2+b^2)^(1/2)+2*a)^(1/2)-b*tan(d*x+c 
)-a-(a^2+b^2)^(1/2))*A*(2*(a^2+b^2)^(1/2)+2*a)^(1/2)*(a^2+b^2)^(1/2)+1/4/d 
/b*ln((a+b*tan(d*x+c))^(1/2)*(2*(a^2+b^2)^(1/2)+2*a)^(1/2)-b*tan(d*x+c)-a- 
(a^2+b^2)^(1/2))*A*(2*(a^2+b^2)^(1/2)+2*a)^(1/2)*a-1/4/d*ln((a+b*tan(d*x+c 
))^(1/2)*(2*(a^2+b^2)^(1/2)+2*a)^(1/2)-b*tan(d*x+c)-a-(a^2+b^2)^(1/2))*B*( 
2*(a^2+b^2)^(1/2)+2*a)^(1/2)-1/d/(2*(a^2+b^2)^(1/2)-2*a)^(1/2)*arctan(((2* 
(a^2+b^2)^(1/2)+2*a)^(1/2)-2*(a+b*tan(d*x+c))^(1/2))/(2*(a^2+b^2)^(1/2)-2* 
a)^(1/2))*B*(a^2+b^2)^(1/2)+1/d*b/(2*(a^2+b^2)^(1/2)-2*a)^(1/2)*arctan(((2 
*(a^2+b^2)^(1/2)+2*a)^(1/2)-2*(a+b*tan(d*x+c))^(1/2))/(2*(a^2+b^2)^(1/2...
 
3.4.22.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1282 vs. \(2 (135) = 270\).

Time = 0.88 (sec) , antiderivative size = 2579, normalized size of antiderivative = 15.44 \[ \int \cot ^2(c+d x) \sqrt {a+b \tan (c+d x)} (A+B \tan (c+d x)) \, dx=\text {Too large to display} \]

input
integrate(cot(d*x+c)^2*(a+b*tan(d*x+c))^(1/2)*(A+B*tan(d*x+c)),x, algorith 
m="fricas")
 
output
[1/2*(a*d*sqrt((2*A*B*b + d^2*sqrt(-(4*A^2*B^2*a^2 + 4*(A^3*B - A*B^3)*a*b 
 + (A^4 - 2*A^2*B^2 + B^4)*b^2)/d^4) - (A^2 - B^2)*a)/d^2)*log(-(2*(A^3*B 
+ A*B^3)*a + (A^4 - B^4)*b)*sqrt(b*tan(d*x + c) + a) + (A*d^3*sqrt(-(4*A^2 
*B^2*a^2 + 4*(A^3*B - A*B^3)*a*b + (A^4 - 2*A^2*B^2 + B^4)*b^2)/d^4) - (2* 
A*B^2*a + (A^2*B - B^3)*b)*d)*sqrt((2*A*B*b + d^2*sqrt(-(4*A^2*B^2*a^2 + 4 
*(A^3*B - A*B^3)*a*b + (A^4 - 2*A^2*B^2 + B^4)*b^2)/d^4) - (A^2 - B^2)*a)/ 
d^2))*tan(d*x + c) - a*d*sqrt((2*A*B*b + d^2*sqrt(-(4*A^2*B^2*a^2 + 4*(A^3 
*B - A*B^3)*a*b + (A^4 - 2*A^2*B^2 + B^4)*b^2)/d^4) - (A^2 - B^2)*a)/d^2)* 
log(-(2*(A^3*B + A*B^3)*a + (A^4 - B^4)*b)*sqrt(b*tan(d*x + c) + a) - (A*d 
^3*sqrt(-(4*A^2*B^2*a^2 + 4*(A^3*B - A*B^3)*a*b + (A^4 - 2*A^2*B^2 + B^4)* 
b^2)/d^4) - (2*A*B^2*a + (A^2*B - B^3)*b)*d)*sqrt((2*A*B*b + d^2*sqrt(-(4* 
A^2*B^2*a^2 + 4*(A^3*B - A*B^3)*a*b + (A^4 - 2*A^2*B^2 + B^4)*b^2)/d^4) - 
(A^2 - B^2)*a)/d^2))*tan(d*x + c) - a*d*sqrt((2*A*B*b - d^2*sqrt(-(4*A^2*B 
^2*a^2 + 4*(A^3*B - A*B^3)*a*b + (A^4 - 2*A^2*B^2 + B^4)*b^2)/d^4) - (A^2 
- B^2)*a)/d^2)*log(-(2*(A^3*B + A*B^3)*a + (A^4 - B^4)*b)*sqrt(b*tan(d*x + 
 c) + a) + (A*d^3*sqrt(-(4*A^2*B^2*a^2 + 4*(A^3*B - A*B^3)*a*b + (A^4 - 2* 
A^2*B^2 + B^4)*b^2)/d^4) + (2*A*B^2*a + (A^2*B - B^3)*b)*d)*sqrt((2*A*B*b 
- d^2*sqrt(-(4*A^2*B^2*a^2 + 4*(A^3*B - A*B^3)*a*b + (A^4 - 2*A^2*B^2 + B^ 
4)*b^2)/d^4) - (A^2 - B^2)*a)/d^2))*tan(d*x + c) + a*d*sqrt((2*A*B*b - d^2 
*sqrt(-(4*A^2*B^2*a^2 + 4*(A^3*B - A*B^3)*a*b + (A^4 - 2*A^2*B^2 + B^4)...
 
3.4.22.6 Sympy [F]

\[ \int \cot ^2(c+d x) \sqrt {a+b \tan (c+d x)} (A+B \tan (c+d x)) \, dx=\int \left (A + B \tan {\left (c + d x \right )}\right ) \sqrt {a + b \tan {\left (c + d x \right )}} \cot ^{2}{\left (c + d x \right )}\, dx \]

input
integrate(cot(d*x+c)**2*(a+b*tan(d*x+c))**(1/2)*(A+B*tan(d*x+c)),x)
 
output
Integral((A + B*tan(c + d*x))*sqrt(a + b*tan(c + d*x))*cot(c + d*x)**2, x)
 
3.4.22.7 Maxima [F]

\[ \int \cot ^2(c+d x) \sqrt {a+b \tan (c+d x)} (A+B \tan (c+d x)) \, dx=\int { {\left (B \tan \left (d x + c\right ) + A\right )} \sqrt {b \tan \left (d x + c\right ) + a} \cot \left (d x + c\right )^{2} \,d x } \]

input
integrate(cot(d*x+c)^2*(a+b*tan(d*x+c))^(1/2)*(A+B*tan(d*x+c)),x, algorith 
m="maxima")
 
output
integrate((B*tan(d*x + c) + A)*sqrt(b*tan(d*x + c) + a)*cot(d*x + c)^2, x)
 
3.4.22.8 Giac [F(-1)]

Timed out. \[ \int \cot ^2(c+d x) \sqrt {a+b \tan (c+d x)} (A+B \tan (c+d x)) \, dx=\text {Timed out} \]

input
integrate(cot(d*x+c)^2*(a+b*tan(d*x+c))^(1/2)*(A+B*tan(d*x+c)),x, algorith 
m="giac")
 
output
Timed out
 
3.4.22.9 Mupad [B] (verification not implemented)

Time = 8.83 (sec) , antiderivative size = 10987, normalized size of antiderivative = 65.79 \[ \int \cot ^2(c+d x) \sqrt {a+b \tan (c+d x)} (A+B \tan (c+d x)) \, dx=\text {Too large to display} \]

input
int(cot(c + d*x)^2*(A + B*tan(c + d*x))*(a + b*tan(c + d*x))^(1/2),x)
 
output
(atan(((((16*(a + b*tan(c + d*x))^(1/2)*(3*A^4*b^12 + 2*B^4*b^12 + 3*A^2*B 
^2*b^12 + 3*A^4*a^2*b^10 + 2*A^4*a^4*b^8 + 6*B^4*a^4*b^8 + 29*A^2*B^2*a^2* 
b^10 - 4*A*B^3*a*b^11 + 8*A^3*B*a*b^11 + 20*A*B^3*a^3*b^9 - 4*A^3*B*a^3*b^ 
9))/d^4 + ((A*b + 2*B*a)*((8*(12*B^3*a^2*b^10*d^2 - 20*A^3*a^3*b^9*d^2 + 1 
2*B^3*a^4*b^8*d^2 + 28*A^2*B*b^12*d^2 - 20*A^3*a*b^11*d^2 + 60*A*B^2*a*b^1 
1*d^2 + 60*A*B^2*a^3*b^9*d^2 - 8*A^2*B*a^2*b^10*d^2 - 36*A^2*B*a^4*b^8*d^2 
))/d^5 - (((16*(a + b*tan(c + d*x))^(1/2)*(36*B^2*a^3*b^8*d^2 - 20*A^2*a^3 
*b^8*d^2 + 32*A*B*b^11*d^2 - 8*A^2*a*b^10*d^2 + 12*B^2*a*b^10*d^2 + 64*A*B 
*a^2*b^9*d^2))/d^4 + ((A*b + 2*B*a)*((8*(32*A*b^11*d^4 + 48*B*a*b^10*d^4 + 
 32*A*a^2*b^9*d^4 + 48*B*a^3*b^8*d^4))/d^5 - (8*(A*b + 2*B*a)*(32*b^10*d^4 
 + 48*a^2*b^8*d^4)*(a + b*tan(c + d*x))^(1/2))/(a^(1/2)*d^5)))/(2*a^(1/2)* 
d))*(A*b + 2*B*a))/(2*a^(1/2)*d)))/(2*a^(1/2)*d))*(A*b + 2*B*a)*1i)/(2*a^( 
1/2)*d) + (((16*(a + b*tan(c + d*x))^(1/2)*(3*A^4*b^12 + 2*B^4*b^12 + 3*A^ 
2*B^2*b^12 + 3*A^4*a^2*b^10 + 2*A^4*a^4*b^8 + 6*B^4*a^4*b^8 + 29*A^2*B^2*a 
^2*b^10 - 4*A*B^3*a*b^11 + 8*A^3*B*a*b^11 + 20*A*B^3*a^3*b^9 - 4*A^3*B*a^3 
*b^9))/d^4 - ((A*b + 2*B*a)*((8*(12*B^3*a^2*b^10*d^2 - 20*A^3*a^3*b^9*d^2 
+ 12*B^3*a^4*b^8*d^2 + 28*A^2*B*b^12*d^2 - 20*A^3*a*b^11*d^2 + 60*A*B^2*a* 
b^11*d^2 + 60*A*B^2*a^3*b^9*d^2 - 8*A^2*B*a^2*b^10*d^2 - 36*A^2*B*a^4*b^8* 
d^2))/d^5 + (((16*(a + b*tan(c + d*x))^(1/2)*(36*B^2*a^3*b^8*d^2 - 20*A^2* 
a^3*b^8*d^2 + 32*A*B*b^11*d^2 - 8*A^2*a*b^10*d^2 + 12*B^2*a*b^10*d^2 + ...